package com.dongway.netcondition.socketToBox;

import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;

import javax.swing.JOptionPane;

public class ReStart {

	public static void reStart(int dev_id) {
		Socket socket = SocketContent.getInstance().getSocket(dev_id);
		byte[] b = { 0x61, 0x31, 0x30, 0x2c, 0x6e, 0x65, 0x74, 0x52, 0x65,
				0x73, 0x65, 0x74, 0x2c, 0x6f, 0x6b, 0x2c, 0x65, 0x6e, 0x64,
				0x0a };

		try {
			OutputStream out = socket.getOutputStream();
			out.write(b);
			System.out.println("重新启动");
			JOptionPane.showMessageDialog(null, "重新启动！");
		} catch (IOException e) {
			System.out.println("重启失败！");
		}

	}

}
